package com.example.mvvmdemo;

import android.app.Application;

import com.example.mvvmdemo.api.Api;
import com.example.mvvmdemo.api.RetrofitClient;
import com.example.mvvmdemo.db.UserDatabase;

/**
 * @author: tuyrt7 on 2020/8/31.
 * Describe:
 */
public class MyApplication extends Application {


    @Override
    public void onCreate() {
        super.onCreate();

        mUserDatabase = UserDatabase.get(this);
        mApi = RetrofitClient.get().getApi();
    }

    private static UserDatabase mUserDatabase;
    private static Api mApi;

    public static UserDatabase getUserDatabase() {
        return mUserDatabase;
    }

    public static Api getApi() {
        return mApi;
    }
}
